package com.itheima.wemedia.feign;

import com.itheima.common.vo.ResultVo;
import com.itheima.wemedia.dto.WmNewsPageReqDto;
import com.itheima.wemedia.pojo.WmNews;
import com.itheima.wemedia.vo.WmNewsVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(name = "leadnews-wemedia",contextId = "wmNewsFeign")
public interface WmNewsFeign {
    /**
     * 通过id查询文章信息
     * @return
     */
    @GetMapping("/api/wmNews/{newsId}")
    ResultVo<WmNews> getWmNewsById(@PathVariable(value = "newsId")Long id);

    /**
     * 通过id更新文章信息
     * @return
     */
    @PutMapping("/api/wmNews/update")
    ResultVo<WmNews> update(@RequestBody WmNews wmNews);

    /**
     * 查询审核通过的文章，状态为8的。进行同步到文章微服务
     * @param dto
     * @return
     */
    @PostMapping("/api/wmNews/list4ArticleSync")
    ResultVo<List<WmNewsVo>> list4ArticleSync(@RequestBody WmNewsPageReqDto dto);

}
